USE [BMIG_Mensual_POST_CADENA]
GO

/****** Object:  StoredProcedure [dbo].[WASP_M0002_SOLICITANTE]    Script Date: 11/24/2011 14:37:09 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[WASP_M0002_SOLICITANTE]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[WASP_M0002_SOLICITANTE]
GO

USE [BMIG_Mensual_POST_CADENA]
GO

/****** Object:  StoredProcedure [dbo].[WASP_M0002_SOLICITANTE]    Script Date: 11/24/2011 14:37:09 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE PROCEDURE [dbo].[WASP_M0002_SOLICITANTE]
AS 
BEGIN
	SELECT	aooper 
			,aosuc 
			,aocta 
			,z073GKPRE
	INTO	dbo.as_solicitante
	FROM	JT73109 
			,Fsd010
			,Z07391 
			,Z073GK
	WHERE	Aosuc = JT73109SUC
	AND 	Aooper = JT73109FPA 
	AND		aotasa <> 0 
	AND 	Aostat <> 99 
	AND		Z07391EST = 'PR'
	AND		Z07391SU1 = Aosuc 
	AND		Z07391OP1 = Aooper 
	AND		Z073GKPRO = Z07391PRO 
	AND		Z073GKINS = Z07391INS 
	AND		Z073GKWOR = Z07391WOR
END

GO


